<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/commons/pages/taglibs.jsp" %>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${naviString}</title>
<link href="${ctx}/commons/styles/themes/blue/styles/style.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/commons/scripts/jquery-ui/themes/redmond/jquery-ui.custom.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div align="center">
  <div align="left" style="width:99%">
    <div align="left" class="nav">${naviString}</div>
    <html-el:form action="/manager/StaffInfo.do" enctype="multipart/form-data">
      <html-el:hidden property="method" value="save" />
      <html-el:hidden property="mod_id" />
      <html-el:hidden property="user_id" />
      <html-el:hidden property="is_sys_user" value="0" /><!-- 公司员工  -->
      <html-el:hidden property="queryString" />
      <br />
      <table width="100%" border="0" align="left" cellpadding="1" cellspacing="1" class="datagrid">
        <tr>
          <th colspan="2">员工管理</th>
        </tr>
        <tr>
          <td width="15%" class="title_item"><span style="color: #F00;">*</span><strong>员工姓名：</strong></td>
          <td width="85%"><html-el:text property="user_name" styleId="user_name" style="width:120px;" /></td>
        </tr>
        <tr>
          <td width="15%" class="title_item"><span style="color: #F00;">*</span><strong>员工图片：</strong></td>
          <td width="85%"><c:if test="${not empty (hf.map.accessory.save_url)}" var="hasImage" ><br/>
              <img src="${ctx}/${hf.map.accessory.save_url}" title="${hf.map.accessory.description}" /><br />
              <input type="checkbox" name="chkReUploadImage" id="chkReUploadImage" value="1" onclick="$('#save_url').toggle();" />
              <label for="chkReUplhfdImage">重新上传图片</label>
              <br/>
              <html-el:file property="save_url" style="display:none;width:500px;" styleId="save_url" />
            </c:if>
            <c:if test="${empty (hf.map.accessory.save_url)}">
              <html-el:file property="save_url" styleId="save_url" style="width:500px;" />
            </c:if>
            <div>上传的图片会自动缩放成合适的尺寸</div></td>
        </tr>
        <tr>
          <td class="title_item"><strong>图片说明：</strong></td>
          <td><html-el:text property="description" value="${hf.map.accessory.description}" maxlength="120" style="width:240px" />
            <html-el:hidden property="acce_id" value="${hf.map.accessory.id}" /></td>
        </tr>
        <tr>
          <td width="15%" class="title_item"><span style="color: #F00;">*</span><strong>性别：</strong></td>
          <td width="85%"><html-el:radio property="sex" styleId="sex" value="0" />男&nbsp;<html-el:radio property="sex" styleId="sex" value="1" />女</td>
        </tr>
        <tr>
          <td width="15%" class="title_item"><span style="color: #F00;">*</span><strong>所在部门：</strong></td>
          <td width="85%"><html-el:select property="dept_id" styleId="dept_id" style="width:150px;">
              <html-el:option value="">请选择...</html-el:option>
          	  <c:forEach var="cur" items="${deptInfoList}">
          	    <html-el:option value="${cur.dept_id}">${cur.dept_name}</html-el:option>
          	  </c:forEach>
            </html-el:select>
          </td>
        </tr>
        <tr>
          <td width="15%" class="title_item"><span style="color: #F00;">*</span><strong>职位：</strong></td>
          <td width="85%"><html-el:text property="position" styleId="position" style="width:120px;" /></td>
        </tr>
        <tr>
          <td width="15%" class="title_item"><strong>生日：</strong></td>
          <td width="85%"><fmt:formatDate value="${hf.map.birthday}" pattern="yyyy-MM-dd" var="_birthday" />
            <html-el:text property="birthday" styleId="birthday" value="${_birthday}" size="10" readonly="true" />
          </td>
        </tr>
        <tr>
          <td width="15%" class="title_item"><strong>手机号码：</strong></td>
          <td width="85%"><html-el:text property="mobile" styleId="mobile" style="width:120px;" /></td>
        </tr>
        <tr>
          <td width="15%" class="title_item"><strong>电子信箱：</strong></td>
          <td width="85%"><html-el:text property="email" styleId="email" style="width:120px;" /></td>
        </tr>
        <tr>
          <td width="15%" class="title_item"><strong>QQ：</strong></td>
          <td width="85%"><html-el:text property="qq" styleId="qq" style="width:120px;" /></td>
        </tr>
        <tr>
          <td width="15%" class="title_item"><strong>MSN：</strong></td>
          <td width="85%"><html-el:text property="msn" styleId="msn" style="width:120px;" /></td>
        </tr>
        <tr>
          <td width="15%" class="title_item"><strong>入司时间：</strong></td>
          <td width="85%"><fmt:formatDate value="${hf.map.in_com_date}" pattern="yyyy-MM-dd" var="_in_com_date" />
            <html-el:text property="in_com_date" styleId="in_com_date" value="${_in_com_date}" size="10" readonly="true" /></td>
        </tr>
        <!--<tr>
          <td class="title_item"><strong>员工感言内容：</strong></td>
          <td><FCK:editor instanceName="staff_word">
              <jsp:attribute name="value">${hf.map.staff_word}</jsp:attribute>
            </FCK:editor>
            <div>1、此处上传的图片不会自动缩放，请用相关做图软件缩放成您想要的大小或手动调整大小！</div>
            <div>2、点击最后一排倒数第三个按钮可实现全屏编辑</div></td>
        </tr>
        --><tr>
          <td width="15%" class="title_item"><span style="color: #F00;">*</span><strong>排序值：</strong></td>
          <td width="85%"><html-el:text property="order_value" styleId="order_value" size="4" maxlength="4" />
            值越大，显示越靠前，范围：0-9999</td>
        </tr>
        <tr>
          <td class="title_item">&nbsp;</td>
          <td><html-el:button property="save" value=" 保 存 " styleId="save" styleClass="ui-state-default ui-corner-all" style="cursor:pointer;" />
            &nbsp;
            <html-el:reset value=" 重 填 " styleClass="ui-state-default ui-corner-all" style="cursor:pointer;" />
            &nbsp;
            <html-el:button property="back" value=" 返 回 " onclick="history.back();" styleClass="ui-state-default ui-corner-all" style="cursor:pointer;" />
            &nbsp;&nbsp; <span id="loading" style="display:none;"><img src="${ctx}/commons/styles/images/loading.gif" style="vertical-align:middle; margin: 2px;" />数据提交中，请稍候...</span></td>
        </tr>
      </table>
    </html-el:form>
  </div>
</div>
<script type="text/javascript" src="${ctx}/commons/scripts/validator.js"></script>
<script type="text/javascript" src="${ctx}/commons/scripts/jquery.js"></script>
<script type="text/javascript" src="${ctx}/commons/scripts/jquery-ui/ui/minified/jquery-ui.custom.min.js"></script>
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
	initStyle();
	
	$("#user_name").attr("datatype","Require").attr("msg","员工姓名必须填写");
	$("input[type='radio'][name='sex']").eq(0).attr("dataType","Group").attr("msg","性别必须选择");
	$("#dept_id").attr("datatype","Require").attr("msg","所在部门必须选择");
	$("#position").attr("datatype","Require").attr("msg","职位必须填写");
	$("#order_value").focus(setOnlyNum).attr("datatype","Integer").attr("msg","排序值必须为整数");

	$("#birthday").datepicker();
	$("#in_com_date").datepicker();
		
	var f = document.forms[0];
	$("#save").click(function(){
		
		
		if(Validator.Validate(f, 1)) {
			$("#loading").show();
			$("#save").attr("disabled", "true");
			$("#reset").attr("disabled", "true");

			f.submit();
		}
	});
});



function initStyle(){
	$("input[type='text']").css({border: "1px solid #ccc"});
	$("input[type='submit'],input[type='reset'],input[type='button']").css({border: "1px solid"});
	$("input[type='text'][readonly],input[type='password'][readonly],textarea[readonly]").css({color:"#000"});
    $("input[type='text'],input[type='password'],textarea").not("[readonly]").focus(function(){
    	$(this).addClass("row_focus");
    }).blur(function(){
    	$(this).removeClass("row_focus");
    });
    
	$("textarea").each(function(){
		this.onpropertychange = function () {
			if (this.scrollHeight > 16) this.style.posHeight = this.scrollHeight;
		};
	});
}

function setOnlyNum() {
	$(this).css("ime-mode", "disabled").attr("t_value", "").attr("o_value", "").bind("dragenter",function(){
		return false;
	});
	$(this).keypress(function (){
		if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/))this.value=this.t_value;else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value;
	}).keyup(function (){
		if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/))this.value=this.t_value;else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value;
	}).blur(function (){
		if(!this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?|\.\d*?)?$/))this.value=this.o_value;else{if(this.value.match(/^\.\d+$/))this.value=0+this.value;if(this.value.match(/^\.$/))this.value=0;this.o_value=this.value;}
		if(this.value.length == 0) this.value = "0";
	});
	//this.text.selected;
}

//]]></script>
</body>
</html>
